﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;

namespace QLBH
{
    [Serializable]
    class DNhanVien: List<CNhanVien>, INV
    {

        public void Load(string filePath)
        {
            Stream str = File.Open(filePath, FileMode.Open);
            BinaryFormatter bFormatter = new BinaryFormatter();
            INV list_Nv = (INV)bFormatter.Deserialize(str);
            str.Close();

            this.Clear();
            foreach (CNhanVien Nv in list_Nv)
            {
                this.Add(Nv);
            }
        }

        public void Save(string filePath)
        {
            Stream str = File.Open(filePath, FileMode.Create);
            BinaryFormatter bFormater = new BinaryFormatter();
            bFormater.Serialize(str, this);
            str.Close();
        }
    }
}
